package org.example;

import org.example.dao.BookDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanLifeCycle {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao = (BookDao) classPathXmlApplicationContext.getBean("bookDao");
        bookDao.save();
//        classPathXmlApplicationContext.registerShutdownHook();
        classPathXmlApplicationContext.close();
    }
}
